package com.jy.app.lib.net;

import com.loopj.android.http.FileAsyncHttpResponseHandler;
import com.jy.app.lib.utils.LogUtil;

import java.io.File;

import cz.msebera.android.httpclient.Header;


/**
 * 文件下载、上传时的异步处理类
 * y
 * Created by jan on 2016/4/20.
 */
public class CommonFileHttpResponseHandler extends FileAsyncHttpResponseHandler {

    public CommonFileHttpResponseHandler(File file) {
        super(file);
    }

    @Override
    public void onFailure(int i, Header[] headers, Throwable throwable, File file) {
        onFailure(file);
    }

    @Override
    public void onSuccess(int i, Header[] headers, File file) {
        onSuccess(file);
    }

    protected void onSuccess(File file){

    }

    protected void onFailure(File file){

    }

    @Override
    public void onProgress(long bytesWritten, long totalSize) {
        super.onProgress(bytesWritten, totalSize);
        LogUtil.i("---onProgress---"+bytesWritten+"===="+totalSize);
    }
}
